<?php
/**
 * 列表Action
 * Enter description here ...
 * @author nijn
 *
 */
class ListAction extends CAction{
	public $modelName = '';
	public $view = 'list';
	public $pageSize;
	public $data = array();
	public $criteria = array();
	
	public function run(){
		$c = $this->controller;
		$modelName = empty($this->modelName) ? $c->modelName : $this->modelName;
		$model = new $modelName('search');
		$criteria = $model->getDbCriteria();
		$criteria->mergeWith(new CDbCriteria($this->criteria));
		$model->unsetAttributes();
		if (isset($_GET[$modelName])) {
			$model->attributes = $_GET[$modelName];
		}
		$c->render($this->view,array_merge($this->data, array(
			'data' => $model->search(),
			'model' => $model,
		)));
	}
}

?>